﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BookShop.Models;
using System.Web.Mvc;

namespace BookShop.Controllers
{

    public class BookAndSortViewModel
    {
        BookShopRepository bookShop = new BookShopRepository();
        public Book Book { get; private set; }
        public SelectList BookSort { get; private set; }

        public BookAndSortViewModel(Book book)
        {
            var sortName = from s in bookShop.ShowAllSort()
                           select s.SortName;
            Book = book;
            BookSort = new SelectList(sortName, book.SortID);
        }
    }
}
